package upload

type FormData struct {
	LocalHash string
	Hash      string
	Path      string
	Name      string
	Ext       string
	Size      int64
}

type fileOption struct {
	f func(*file)
}

func (f *fileOption) apply(o *file) {
	f.f(o)
}

func createFileOption(f func(*file)) fileOption {
	return fileOption{
		f: f,
	}
}

type fileSetOption struct {
}

var Set = new(fileSetOption)

func (f *fileSetOption) SetMineType(mime string) fileOption {
	return createFileOption(func(f *file) {
		f.option.MineType = mime
	})
}

func (f *fileSetOption) SetTitle(title string) fileOption {
	return createFileOption(func(f *file) {
		f.option.FileName = title
	})
}
